#ifndef LIBTORRENT_RATE_H
#define LIBTORRENT_RATE_H
#include "timer.h"
#include <list>
#include <utility>

namespace torrent {

// Assumes Timer::cache() is up to date.
class Rate {
public:
	Rate() : m_new(true) {}

	// Bytes per second. Not using default parm since it borks my algorithms.
	// quick - Zero the rate quickly.
	int rate(bool quick);

	~Rate();

private:
	bool m_new;

	std::list<std::pair<Timer, int>> m_entries;
};

} // namespace torrent

#endif // LIBTORRENT_RATE_H */
